<template>
  <div class="user">
    <!-- 左侧导航   -->
    <div class="menu">
      <el-menu :default-active="route.path" class="el-menu-vertical-demo">
        <div class="top">
          <el-icon>
            <House />
          </el-icon>
          <span> / 会员中心</span>
        </div>
        <el-menu-item index="/user/certification" @click="to('certification')">
          <el-icon>
            <setting />
          </el-icon>
          <span>实名认证</span>
        </el-menu-item>
        <el-menu-item index="/user/order" @click="to('order')">
          <el-icon>
            <icon-menu />
          </el-icon>
          <span>挂号订单</span>
        </el-menu-item>
        <el-menu-item index="/user/patient" @click="to('patient')">
          <el-icon>
            <document />
          </el-icon>
          <span>就诊人管理</span>
        </el-menu-item>
        <el-menu-item index="/user/profile" @click="to('profile')">
          <el-icon>
            <setting />
          </el-icon>
          <span>账号信息</span>
        </el-menu-item>
        <el-menu-item index="/user/feedback" @click="to('feedback')">
          <el-icon>
            <setting />
          </el-icon>
          <span>意见反馈</span>
        </el-menu-item>
      </el-menu>
    </div>
    <!-- 右侧展示会员区   -->
    <div class="content">
      <router-view />
    </div>
  </div>
</template>
<script lang="ts" name="User" setup>
import {
  Document,
  House,
  Menu as IconMenu,
  Setting,
} from "@element-plus/icons-vue";
import router from "@/router";
import { useRoute } from "vue-router";

let route = useRoute();

// 跳转路由
const to = (path: string) => {
  router.push({ name: path });
};
</script>

<style lang="scss" scoped>
.user {
  display: flex;
  margin-top: 70px;
  width: 1200px;
  min-height: 700px;

  .menu {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;

    .top {
      color: #7f7f7f;
      margin-left: 25px;
    }
  }

  .content {
    flex: 8;
  }
}
</style>
